<template>
  <el-dialog
    :visible.sync="visible"
    :before-close="beforeClose"
    :close-on-click-modal="false"
    append-to-body
    class="dialog-sm"
    top="30px"
    width="800px"
  >
    <el-tabs v-model="active">
      <el-tab-pane label="基本信息" name="detail">
        <business-info :query-id="queryId" v-if="isClass"></business-info>
        <base-info :query-id="queryId" v-else></base-info>
      </el-tab-pane>
      <el-tab-pane label="登记信息" name="register">
        <register-edit :view-mode="true" :query-id="relatedId"></register-edit>
      </el-tab-pane>
    </el-tabs>
  </el-dialog>
</template>

<script>
import BaseInfo from '@/gov/views/bus/import/xinnong/components/Base'
import BusinessInfo from '@/gov/views/bus/import/class/MainBusinessView'
import RegisterEdit from '@/gov/views/bus/register/components/RegisterEdit'
export default {
  components: {
    BaseInfo,
    BusinessInfo,
    RegisterEdit,
  },
  props: {
    visible: Boolean,
    relatedId: String,
    queryId: String,
    isClass: { type: Boolean, default: false },
  },
  data() {
    return {
      active: 'detail',
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    beforeClose() {
      this.active = 'detail'
      this.$emit('update:visible', false)
    },
  },
}
</script>

<style lang="scss" scoped></style>
